Java Compiler Compiler Version 5.0 (Documentation Generator Version 0.1.4)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>BNF for standard input</TITLE>
</HEAD>
<BODY>
<H1 ALIGN=CENTER>BNF for standard input</H1>
<H2 ALIGN=CENTER>TOKENS</H2>
<TABLE>
 <!-- Special token -->
 <TR>
  <TD>
<PRE>
// Skip white spaces
</PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; SKIP : {
" "
| "\t"
| "\n"
| "\r"
}

   </PRE>
  </TD>
 </TR>
 <!-- Special token -->
 <TR>
  <TD>
<PRE>
// Skip line comments
</PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; SKIP : {
&lt;"//" (~["\n"])* "\n"&gt;
}

   </PRE>
  </TD>
 </TR>
 <!-- Special token -->
 <TR>
  <TD>
<PRE>
// Skip block comments
// The automata for this is:
//                        .--- ~'*' ~'/'-----.
//                        |                  |
//	    '/'    '*'    v      '*'         |  '/'
//	(1)---->(2)---->( 3 )------------->( 4 )---->((5))
//                      |  ^               |  ^
//                      |  |               |  |
//		        ---                ---
//                      ~'*'               '*'
//
</PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; SKIP : {
&lt;"/*" ((~["*"])* (["*"])+ ~["*","/"])* (~["*"])* (["*"])+ "/"&gt;
}

   </PRE>
  </TD>
 </TR>
 <!-- Special token -->
 <TR>
  <TD>
<PRE>
// Reserved Keywords
</PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;TOK_BOOLEAN: "boolean"&gt;
| &lt;TOK_BREAK: "break"&gt;
| &lt;TOK_CLASS: "class"&gt;
| &lt;TOK_CONTINUE: "continue"&gt;
| &lt;TOK_ELSE: "else"&gt;
| &lt;TOK_EXTENDS: "extends"&gt;
| &lt;TOK_FALSE: "false"&gt;
| &lt;TOK_FLOAT: "float"&gt;
| &lt;TOK_FOR: "for"&gt;
| &lt;TOK_IF: "if"&gt;
| &lt;TOK_INT: "int"&gt;
| &lt;TOK_NEW: "new"&gt;
| &lt;TOK_NULL: "null"&gt;
| &lt;TOK_PRIVATE: "private"&gt;
| &lt;TOK_PUBLIC: "public"&gt;
| &lt;TOK_RETURN: "return"&gt;
| &lt;TOK_STATIC: "static"&gt;
| &lt;TOK_SUPER: "super"&gt;
| &lt;TOK_THIS: "this"&gt;
| &lt;TOK_TRUE: "true"&gt;
| &lt;TOK_VOID: "void"&gt;
| &lt;TOK_WHILE: "while"&gt;
}

   </PRE>
  </TD>
 </TR>
 <!-- Special token -->
 <TR>
  <TD>
<PRE>
// Letters and digits
</PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;#LETTER: ["a"-"z","A"-"Z"]&gt;
}

   </PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;#DIGITS: (["0"-"9"])+&gt;
}

   </PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;#STRING_CONTENT: (~["\"","\\","\n"])*&gt;
}

   </PRE>
  </TD>
 </TR>
 <!-- Special token -->
 <TR>
  <TD>
<PRE>
// Constants
</PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;TOK_INT_CONST: &lt;DIGITS&gt;&gt;
| &lt;TOK_FLOAT_CONST: &lt;DIGITS&gt; "." &lt;DIGITS&gt;&gt;
| &lt;TOK_STRING_CONST: "\"" (&lt;STRING_CONTENT&gt; "\\" ~[])* &lt;STRING_CONTENT&gt; "\""&gt;
}

   </PRE>
  </TD>
 </TR>
 <!-- Special token -->
 <TR>
  <TD>
<PRE>
// Identifier
</PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;TOK_ID: &lt;LETTER&gt; (&lt;LETTER&gt; | &lt;DIGITS&gt; | "_")*&gt;
}

   </PRE>
  </TD>
 </TR>
 <!-- Special token -->
 <TR>
  <TD>
<PRE>
// Braces and Parathesis
</PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;TOK_OPEN_SQ_BRACKET: "["&gt;
| &lt;TOK_CLOSE_SQ_BRACKET: "]"&gt;
| &lt;TOK_OPEN_PAREN: "("&gt;
| &lt;TOK_CLOSE_PAREN: ")"&gt;
| &lt;TOK_OPEN_BRACE: "{"&gt;
| &lt;TOK_CLOSE_BRACE: "}"&gt;
}

   </PRE>
  </TD>
 </TR>
 <!-- Special token -->
 <TR>
  <TD>
<PRE>
// Arithmetic Operators
</PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;TOK_PLUS: "+"&gt;
| &lt;TOK_MINUS: "-"&gt;
| &lt;TOK_MULTIPLY: "*"&gt;
| &lt;TOK_DIVIDE: "/"&gt;
}

   </PRE>
  </TD>
 </TR>
 <!-- Special token -->
 <TR>
  <TD>
<PRE>
// Assignment Opertor
</PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;TOK_EQUAL: "="&gt;
}

   </PRE>
  </TD>
 </TR>
 <!-- Special token -->
 <TR>
  <TD>
<PRE>
// Logical Operators
</PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;TOK_AND: "&amp;&amp;"&gt;
| &lt;TOK_OR: "||"&gt;
| &lt;TOK_NOT: "!"&gt;
| &lt;TOK_GREATER: "&gt;"&gt;
| &lt;TOK_LESSER: "&lt;"&gt;
| &lt;TOK_EQUAL_EQUAL: "=="&gt;
| &lt;TOK_NOT_EQUAL: "!="&gt;
| &lt;TOK_GREATER_OR_EQUAL: "&gt;="&gt;
| &lt;TOK_LESSER_OR_EQUAL: "&lt;="&gt;
}

   </PRE>
  </TD>
 </TR>
 <!-- Special token -->
 <TR>
  <TD>
<PRE>
// Other Symbols
</PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; TOKEN : {
&lt;TOK_COMMA: ","&gt;
| &lt;TOK_DOT: "."&gt;
| &lt;TOK_SEMICOLON: ";"&gt;
}

   </PRE>
  </TD>
 </TR>
 <!-- Special token -->
 <TR>
  <TD>
<PRE>
// Error Token
</PRE>
  </TD>
 </TR>
 <!-- Token -->
 <TR>
  <TD>
   <PRE>
&lt;DEFAULT&gt; SKIP : {
&lt;~[]&gt; : {
}

   </PRE>
  </TD>
 </TR>
</TABLE>
<H2 ALIGN=CENTER>NON-TERMINALS</H2>
<TABLE>
</TABLE>
</BODY>
</HTML>
